function gzFn(kind){
	if(zeai.empty(kind)){var i=zeai.tag(this,'i')[0];}
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_gz',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			gz.addClass('ed');if(zeai.empty(kind))i.html('&#xe62b;');
		}else{
			gz.removeClass('ed');if(zeai.empty(kind))i.html('&#xe61c;');
		}
		zeai.msg(rs.msg);
	});
}
function photo_mFn(){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_photo_s_zoom',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			ZeaiM.piczoom({browser:browser,b:photo_b,list:[photo_b]});
		}else{
			zeai.alertplus({'title':'请上传本人真实头像','content':rs.msg,'title1':'取消','title2':'去上传','fn1':function(){zeai.alertplus(0);},
				'fn2':function(){zeai.alertplus(0);zeai.openurl(HOST+'/m/my_info'+zeai.ajxext+'&jumpurl='+encodeURIComponent(rs.jumpurl));}
			});
		}
	});
}
function PlistFn(pic_list){
	zeai.listEach(zeai.tag(Plist,'img'),function(obj){
		var b=obj.src.replace('_s','_b');
		obj.onclick=function(){
			zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_Plist_zoom',uid:uid}},function(e){rs=zeai.jsoneval(e);
				if(rs.flag==1){
					ZeaiM.piczoom({browser:browser,b:b,list:pic_list});
				}else{
					zeai.alertplus({'title':'请上传个人相册','content':rs.msg,'title1':'取消','title2':'去上传',
						'fn1':function(){zeai.alertplus(0);},
						'fn2':function(){zeai.alertplus(0);zeai.openurl(HOST+'/m/my_photo'+zeai.ajxext+'&jumpurl='+encodeURIComponent(rs.jumpurl));}
					});
				}
			});
		}
	});
}
function UblackFn(){
	this.style.zIndex=999;
	zeai.mask({son:rtbox,close:function(e){}});
}
function inBlackFn(){
	var self=this;
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_inblack',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		var i=zeai.tag(gz,'i')[0];
		if(rs.flag==1){
			self.addClass('ed');gz.removeClass('ed');i.html('&#xe61c;');
		}else{
			self.removeClass('ed');
		}
		Mrtbox.click();
		zeai.msg(rs.msg);
	});
}
function ucertFn(){zeai.openurl(HOST+'/m/u_cert'+zeai.ajxext+'uid='+uid);}
function tgxqkFn(){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_tgxqk',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			ZeaiM.page.load(HOST+'/m/tg_my_ucard.php?submitok=tg_my_ucard_list&uid='+uid,'u','tg_my_ucard_list');
		}else{
			zeai.openurl(HOST+'/m/tg_index.php');
		}
	});
}
/*gift*/
function setgift(giftbtn,box){
	if(!zeai.empty(giftbtn)){giftbtn.onclick = function(){gift_ajaxdata(0,box);}}
	var li,id,rs,gid,div;
	zeai.listEach(zeai.tag(gift,'li'),function(li){li.onclick = function(){gift_ajaxdata(li.getAttribute("gid"),box);}});
}
function gift_ajaxdata(gid,box){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_gift_div',gid:gid,uid:uid}},function(e){var rs=zeai.jsoneval(e);
		var div=ZeaiM.div2({obj:box,title:'送礼物给【'+rs.nickname+'】',w:30,h:29});
		var em=zeai.tag(box,'em')[0];em=em.children;
		em[0].src       = rs.picurl;
		em[1].innerHTML = rs.title;
		em[2].innerHTML = rs.price + lovebstr;
		var a=zeai.tag(box,'a'),tipbox;
		if(box.id=='box_gift_index'){
			a[0].onclick = function (){div.click();}
		}else{
			a[0].onclick = function (){div.click();zeai.openurl(HOST+'/m/gift'+zeai.ajxext+'uid='+uid);}
		}
		tipbox=tips0_100_0;
		a[1].onclick = function (){
			zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_gift_send',gid:rs.id,uid:uid}},function(e2){rs2=zeai.jsoneval(e2);
				if(rs2.flag==1){
					div.click();
					tipbox.html('<i class="ico hi">&#xe600;</i>礼物已送出');tipbox.show();setTimeout(function(){tipbox.hide()},2100);
					if(!zeai.empty(rs2.C) && !zeai.empty(o('gift'))){
						gift.html('<li gid="0" uid="'+uid+'"><i class="ico">&#xe600;</i><font>收到'+rs2.giftotalnum+'份</font></li>');
						gift.append(rs2.C);
						setgift(gift,box_gift);
					}
				}else if(rs2.flag=='noloveb'){
					zeai.alertplus({title:rs2.title,content:rs2.msg,title1:'取消','title2':'去充值','fn1':function(){zeai.alertplus(0);},
						'fn2':function(){zeai.alertplus(0);zeai.openurl(HOST+'/m/my_loveb'+zeai.ajxext+'t=3&jumpurl='+encodeURIComponent(rs2.jumpurl));}
					});
				}else{
					zeai.msg(rs2.msg);
				}
			});
		}
	});
}
function mydataFn(){zeai.openurl(HOST+'/m/u_data'+zeai.ajxext+'submitok=u_data&uid='+uid);}
function chcitFn(){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_sendchcit',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		//zeai.msg(0);zeai.msg(rs.msg);
		chcit.style.backgroundColor='#13CA87';chcit.html('<i class="ico">&#xe60f;</i> 提醒成功');
		if(rs.flag==1){setTimeout(function(){chcit.parentNode.remove();},2000);}
	});
}
function chcitFn2(){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_sendchcit',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		zeai.msg(0);zeai.msg(rs.msg);
		if(rs.flag==1){chcit2.style.backgroundColor='#13CA87';chcit2.html('<i class="ico">&#xe60f;</i> 提醒成功');}
	});
}
window.onload=function(){
	if(!zeai.empty(o('ifadmbtn')))o('ifadmbtn').onclick=function(){
		ZeaiM.div2({obj:ifadmbox,title:'用户查看/管理',w:30,h:35});
	}
	if(!zeai.empty(o('chcit')))o('chcit').onclick=chcitFn;
	if(!zeai.empty(o('agree')))agree.onclick=function(){agreeFn(agree);}
	if(!zeai.empty(o('agree2')))agree2.onclick=function(){agreeFn(agree2);}
}
function utext(uid){
	zeai.copy(uid,function(){zeai.msg('《个人资料》复制成功<br>您可以粘贴分享给好友啦');})
	return false;
	zeai.ajax('u'+zeai.ajxext+'submitok=utext&uid='+uid,function(e){var rs=zeai.jsoneval(e);
		if (rs.flag == 1){
			zeai.copy(rs.C,function(){zeai.msg('《个人资料》复制成功<br>您可以粘贴分享给好友啦');})
		}else{
			zeai.msg(rs.msg);	
		}
	});
}
function agreeFn(idd){
	var self=idd;
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_agree',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			if(!self.hasClass('ed')){
				self.addClass('ed');
				var font=self.lastChild;
				font.html(parseInt(font.innerHTML)+1);
				zeai.msg(rs.msg,{time:1});
			}
		}
	});
}


function admuFn(kind,uid){zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_adm',kind:kind,uid:uid}},function(e){var rs=zeai.jsoneval(e);zeai.msg(rs.msg);});}
function hiFn_send(hi_text){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_senddzh',uid:uid,hi_text:hi_text}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			hi.hide();
			tips0_100_0.html('<i class="ico hi">&#xe6bd;</i>招呼已发送');tips0_100_0.show();setTimeout(function(){tips0_100_0.hide()},2100);
		}else{
			ZeaiM.sorry(rs);
		}
	});
}
function hiFn(){hiFn_send('');}
function hiFn_hand(){
	ZeaiM.div_up({obj:hi_handbox,h:37});
}
function hi_refreshbtn(uid){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,data:{submitok:'ajax_hi_rand',uid:uid}},function(e){
		if(!zeai.empty(e)){
			hi_list.html(zeai.html_decode(e));
			var ulli=zeai.tag(hi_list,'li');
			zeai.listEach(ulli,function(obj){obj.onclick=function(){resetclass(ulli);obj.class('ed');}});
		}else{
			zeai.msg('管理员很懒，没有增加打招呼短语');	
		}
	});
}
function resetclass(ulli){zeai.listEach(ulli,function(obj){if(obj.hasClass('ed'))obj.removeClass('ed');});}
function hi_btnFn(uid){
	var hi_text='';
	zeai.listEach(zeai.tag(hi_list,'li'),function(obj){
		if(obj.hasClass('ed')){c = obj.innerHTML;hi_text = c.replace(/<i.*?>.*?<\/i>/ig,"");}
	});
	if(!zeai.empty(hi_text)){
		div_up_close.click();
		hiFn_send(hi_text);
	}else{
		zeai.msg('请选择要发送的打招呼短语');
	}
}
function hnFn(){ZeaiM.div_up({obj:hnbox,h:36});}
function hnFn2(){ZeaiM.div_up({obj:homekefuewm,h:24});}
function qx_btnFn(uid,admid,admname){
	var str=(!zeai.empty(qx_1price_C))?qx_1price_C:'';
	zeai.alertplus({title:'确定委托【'+admname+'】牵线么？',content:str,title1:'取消',title2:'确定',
		fn1:function(){zeai.alertplus(0);},
		fn2:function(){zeai.alertplus(0);
		
			zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_qx',uid:uid,admid:admid}},function(e){var rs=zeai.jsoneval(e);
				if(rs.flag==1){
					zeai.msg(rs.msg,{time:4});
					setTimeout(function(){location.reload(true);},4000);
					//div_up_close.click();
					//o('qx_btnFn').html('<i class="ico">&#xe61b;</i> 牵线中');o('qx_btnFn').removeClass('zeaibg');o('qx_btnFn').addClass('HUANG');
				}else if(rs.flag=='qx_1price'){
					ZeaiM.div_up({obj:czbox,h:winh});
				}else{
					alertpro_mask.click();
					ZeaiM.sorry(rs);
				}
			});
			
		}
	});
}
function hh_wxFn(){
	zeai.ajax({url:MHOST+'/u'+zeai.extname,js:1,data:{submitok:'ajax_iflogin',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			ZeaiM.div2({obj:hh_wx_form,title:'输入您本人微信号',w:30,h:29});
		}else{
			ZeaiM.sorry(rs);
		}
	});
}
function hh_mobFn(){
	zeai.ajax({url:MHOST+'/u'+zeai.extname,js:1,data:{submitok:'ajax_iflogin',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			ZeaiM.div2({obj:hh_mob_form,title:'输入您本人手机号码',w:30,h:29});
		}else{
			ZeaiM.sorry(rs);
		}
	});
}
function hhsend(formstr){
	zeai.ajax({url:MHOST+'/u'+zeai.extname,js:1,form:o(formstr)},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			if(!zeai.empty(o('Mhhbox')))Mhhbox.click();
			div_close.click();
			zeai.alert(rs.msg,MHOST+'/u'+zeai.ajxext+'uid='+uid,'我知道了');
		}else if(rs.flag=='nologin'){
			zeai.openurl(MHOST+'/login'+zeai.ajxext+'jumpurl='+encodeURIComponent(rs.jumpurl));
		}else{
			ZeaiM.sorry(rs);
		}
	});
}

/*u2.js*/
function gift2_btnFn(){ZeaiM.div_up({obj:giftbox,h:37});}
function gift2_load(){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,data:{submitok:'ajax_gift2_rand',uid:uid}},function(e){
		if(!zeai.empty(e)){
			giflist.html(zeai.html_decode(e));
			var ulli=zeai.tag(giflist,'li');
			zeai.listEach(ulli,function(li){li.onclick=function(){
				gid=li.getAttribute("gid");
				gift2_ajaxdata(gid,box_gift);
				
			}});
		}else{
			zeai.msg('管理员很懒，没有上架礼物');	
		}
	});
}
function gift2_ajaxdata(gid,box){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_gift_div',gid:gid,uid:uid}},function(e){var rs=zeai.jsoneval(e);
		var div=ZeaiM.div2({obj:box,title:'送礼物给【'+rs.nickname+'】',w:30,h:29});
		var em=zeai.tag(box,'em')[0];em=em.children;
		em[0].src       = rs.picurl;
		em[1].innerHTML = rs.title;
		em[2].innerHTML = rs.price + lovebstr;
		var a=zeai.tag(box,'a'),tipbox;
		a[0].onclick = function (){div.click();}
		tipbox=tips0_100_0;
		a[1].onclick = function (){
			zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_gift_send',gid:rs.id,uid:uid}},function(e2){rs2=zeai.jsoneval(e2);
				if(rs2.flag==1){
					div.click();div_up_close.click();
					tipbox.html('<i class="ico hi">&#xe600;</i>礼物已送出');tipbox.show();setTimeout(function(){tipbox.hide()},2100);
					if(!zeai.empty(rs2.C) && !zeai.empty(o('gift'))){
						gift.html('<li gid="0" uid="'+uid+'"><i class="ico">&#xe600;</i><font>收到'+rs2.giftotalnum+'份</font></li>');
						gift.append(rs2.C);
						//setgift(gift,box_gift);
					}
				}else if(rs2.flag=='noloveb'){
					zeai.alertplus({title:rs2.title,content:rs2.msg,title1:'取消','title2':'去充值','fn1':function(){zeai.alertplus(0);},
						'fn2':function(){zeai.alertplus(0);zeai.openurl(HOST+'/m/my_loveb'+zeai.ajxext+'t=3&jumpurl='+encodeURIComponent(rs2.jumpurl));}
					});
				}else{
					zeai.msg(rs2.msg);
				}
			});
		}
	});
}

function inBlackFn2(){
	var self=this;
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_inblack',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			self.addClass('ed');gz2.removeClass('ed');
		}else{
			self.removeClass('ed');
		}
		Mhmd_box.click();
		zeai.msg(rs.msg);
	});
}
function bbsaddbtnFn(){
	zeai.ajax({url:MHOST+'/u'+zeai.extname,js:1,data:{submitok:'ajax_bbs_iflogin',uid:uid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1)ZeaiM.div2({obj:zeai_u_bbs_form,title:'评价Ta',w:30,h:24});
	});
}
function bbsaddbtnsaveFn(){
	if(zeai.empty(contentubbs.value) || zeai.str_len(contentubbs.value)>2000){zeai.msg('请输入评价内容1000字以内',{time:1});return false;}
	contentubbs.value=zeai.clearhtml(contentubbs.value);
	zeai.ajax({url:MHOST+'/u'+zeai.extname,js:1,form:zeai_u_bbs_form},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){zeai.msg(rs.msg);setTimeout(function(){location.reload(true);},1000);}else{ZeaiM.sorry(rs);}
	});
}